class Employee:
    # 类变量，用于记录实例化的对象个数
    count = 0

    def __init__(self, name):
        self.name = name
        # 实例化对象时，自动将 count 加1
        Employee.count += 1

    @classmethod
    def total_instances(cls):
        # 统计输出员工类总共实例化了多少对象
        print("Total number of instances created:", cls.count)


# 创建员工类的实例
emp1 = Employee("John")
emp2 = Employee("Alice")
emp3 = Employee("Bob")

# 输出实例化对象的个数
Employee.total_instances()
